This is a utility program I built with REALbasic. When I acquired a new G3/266, I chose to leave my trusty Zip drive connected to my older Mac. As a result, I lost the use of a handy utility provided by Iomega called Personal Backup. So I decided to develop this little program to help me back up selected important folders to the Zip via network. The result is SaveIt.
How SaveIt Works
If you're familiar with Personal Backup, you'll already have something of an idea how SaveIt operates. But here's an overview. First, let's look at each of its menus, where most of this information can be covered.
THE MENUS
About
As you might expect, this is where I get a chance to toot my own horn. It will always reflect the current version and advertise for REALbasic.
File
This is where you can select New Save Set, Edit Save Set, Delete Save Set, or Quit.
File->New Save Set
When you select this option, you'll be presented with a dialog where you can select the Source and Destination folders. Naturally, they must be online and available in order to select them. Once you've OK'd them (and they must be different), they'll appear in your "Save Sets" window. You'll notice that they show "Never Used" where other Save Sets show the last date used. Any time you make a change to a Save Set, including executing one, the changes will be saved in a file over in the Preferences folder inside your System Folder. A folder named SaveIt Sets will be created in the Preferences folder, and each Save Set will have its own file. If you wish to delete a Save Set while not running SaveIt, you can simply delete its file. Filenames begin with "ss" (short for SaveIt Save Set), and will have the year, month, day, hour and minute at the time they're saved. For example, if you create a new Save Set and then quit SaveIt, and the date/time is September 10, 1998, at 7:30:10 PM, your file will be named "ss19980910193010." The filename will not be changed unless you delete and then recreate the Save Set.
File->Edit Save Set
This menu item will only be available if you have selected one of the Save Sets in the main window. When selected, it will present you with a dialog just like that used for creating new Save Sets, showing the currently selected folders' paths and allowing you to change either or both. SaveIt doesn't implement any form of Undo, so once you OK this dialog, the changes are permanent. This same functionality can be accessed via the Edit button in the main window.
File->Delete Save Set
This menu option (also only available when a Save Set is selected in the main window) will allow you to delete any Save Set. You'll be prompted to confirm before the delete is done, since this action cannot be undone. If the Save Set has been associated with a file (as described above), the file will be deleted on your confirmation.
File->Quit
This option quits SaveIt and causes any Save Set files to be updated or created. In the event that you create or edit Save Sets and SaveIt does not quit normally (say a force quit, or a system crash), the changes to files will be lost.
Edit
No features of the Edit menu are supported in Hangman.
Help
This menu is a Macintosh standard, not provided by me.
THE MAIN WINDOW
This is your primary interface to SaveIt. It consists of a scrollable list of Save Sets, a Run button, and an Edit button.
The Run Button
When you've selected any Save Set in the list, SaveIt will automatically check to determine whether the folders (or volumes) pointed to are present. If so, the Run button becomes active; otherwise it remains unavailable. So if you chose a Zip disk or floppy and it's currently not mounted, this will occur. You'll see the same behavior if either source or destination is an actual folder and cannot be found. If you re-create the appropriate folder, you can unselect and then reselect the item to activate the Run button. You can also execute any Save Set by double-clicking on it in the list. If you do, SaveIt will inform you if either folder is unavailable.
The Edit Button
This button will only be active if you have selected a Save Set in the list. It will be activated under the same conditions that activate the File->Edit Save Set menu item. You can edit a Save Set even if one of its folders isn't available. But if you do make changes, the selected folders or volumes must be available.
The Save Sets List
As I described earlier, each Save Set you've created will have an entry in this list. Each one is read from a single file in the SaveIt Save Sets folder in your Preferences folder. There are three items in the list for each Save Set: the source folder's name, the destination folder's name, and the date/time this Save Set was last used. You'll only see the folder names in the list, but SaveIt actually stores the complete pathname to each folder.
Running (or Executing) a Save Set
When you click the Run button, or double-click a Save Set, it will be "executed." This means that its backup actions will be carried out. Here's how it works.
Step 1.
First, SaveIt will look at all the items in your destination folder. Each one will be checked to see if it exists in the source folder. Any that do not exist will be removed. Note that special care has been taken to ensure that this doesn't destroy any floppies or other volumes. That is, the Desktop file, Desktop Folder, Trash folder, and other "special" items at the root level of a volume aren't touched. Any items that are removed will NOT be moved to the Trash, but will be deleted. This can only be undone with a data/file retrieval program, such as Norton's Unerase. If any item to be deleted is a folder, its entire contents will be deleted in the same fashion.
Step 2.
Second, SaveIt will look at all the items in your source folder. For each one, it will look for an equivalent in the destination folder. If none is found, it will be copied (folders will be copied over in their entirety in this situation). If one is found, it will be replaced only if the one in your source folder is newer.
Special Steps.
In the process of deleting any items from the destination folder which no longer belong there, or copying outdated items, SaveIt will check each to determine whether they are locked. For each such locked file, you'll be presented with a confirmation dialog asking whether to delete/replace the locked file.
KNOWN PROBLEMS AND INCOMPATIBILITIES
There aren't any known incompatibilities between SaveIt and any other software or hardware. But there are a few minor quirks I should mention.
The biggest of these is aliases. Because of the way REALbasic handles aliases, you might have problems if there are aliases in either your source or destination folder. Any time that SaveIt encounters an alias, it automatically resolves it to its original file/folder. That means aliases found (in Step 1 as described above) in the destination folder but not in the source folder will cause the ORIGINAL file to be found and deleted! If the alias is to a folder, the ORIGINAL folder will be found and its complete contents removed! Then, during Step 2, each item in the source folder will be similarly evaluated. If any file or folder is an alias, its original will be copied to the destination. Unfortunately, this is how REALbasic handles aliases, so it's not something I can fix. There are plans in a future version (a professional release due out sometime in 1999) to let programs identify aliases and choose whether or not to resolve them. If and when I decide that SaveIt has received wide enough interest to make such a correction, I'll buy the upgrade to REALbasic and correct this problem.
The only other quirk presently known is with being unable to detect a full disk. In my testing, I intentionally overfilled a floppy. SaveIt doesn't produce any kind of error message when a disk full situation is encountered. While not yet confirmed, I suspect that this too is part of how REALbasic handles files. If and when I discover a way to correct this, I will do so immediately.
One last thing: I haven't actually encountered this potential problem, but I have thought about it and feel it fair to let you in on it. We programmers know about something called "the stack" used in our programs. It's a way for programs to keep up with where they are when one part of a program calls another. It occurs to me that there is the possibility of a Stack Overflow Exception if your source folder happens to be VERY deep and have lots of subfolders. I didn't take time to create a situation like this to see if it happens, but it seems possible under such circumstances. If it SHOULD occur, I'd like to make a special request of you. If possible, try and provide me a detailed listing of the folder hierarchy. Then, try increasing SaveIt's memory allocation and see if it resolves the problem (or allows it to continue further).
LEGAL STUFF
This program is "Feedback-Ware" -- I did it because I needed it and to continue learning the wonders of REALbasic. I retain copyrights to the program, but you can use it to your heart's content and give it to everyone you know. I'm not asking for any money or other valuables, not even the postage for a postcard. I simply ask that you try it out and send me feedback. Send me an email, tell me you found SaveIt, tell me when, where, what version, and tell me what you think of it. How do you think I could make it better? Did you find a bug?
That's it -- just your feedback, good or bad. And tell others about it if you like it. Or let me know what other games, utilities, or useful goodies you think would be interesting so that I can have more ideas for developing (more) useful Mac programs with REALbasic.
This is the second program I developed with REALbasic. The first was a rather addictive (if I do say so myself) game of Hangman. Like SaveIt, Hangman will usually be available at my FTP site.
Speaking of my FTP site, I haven't gone formal or anything and though up a snazzy "software company" name for myself. I'm a professional programmer by day, but the Mac stuff I do just for me. (Perhaps someday I'll be able to do Mac programming for a living.) So my personal FTP site (provided by my outstanding ISP) is at <ftp://ftp.mindspring.com/users/sjacksn>.
= Steve =
sjacksn@mindspring.com
Version History
1.0 -- 13 September 1998 -- Initial release of SaveIt